package com.ds.lens.flink.monitor.common;

import com.ds.lens.data.common.document.DataPoint;

import java.util.Comparator;

public class DataPointComparator implements Comparator<DataPoint> {
    @Override
    public int compare(DataPoint o1, DataPoint o2) {
        if (o1.getTimeStamp() < o2.getTimeStamp()) {
            return -1;
        } else if (o1.getTimeStamp() > o2.getTimeStamp()) {
            return 1;
        } else {
            return 0;
        }
    }
}
